package com.cml.common.util;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

/**
 * 姓名：陈茂林
 * 时间：2023/11/10 8:51
 * 描述：
 */
public class SocketChannelParseIntegerUtil {
    public  static  Integer parse(SocketChannel socketChannel) throws IOException {
        ByteBuffer messageLength = ByteBuffer.allocate(4);
        socketChannel.read(messageLength );
        messageLength.flip();

       return messageLength.getInt();
    }


}
